<template>
  <div class="generalize.vue">
    <div>
      <img
        class="gener_img"
        :src="list.img"
        alt=""
      >
      <p class="crumbs_cont_txt">
        {{list.wangEditor}}
      </p>
    </div>
  </div>
</template>

<script>
export default {
  name: "generalize.vue",
  props: {
    sonList: {
      type: Array
    }
  },
  data() {
    return {
      list: []
    };
  },
  watch: {
    sonList(newlIst, olist) {
      newlIst.forEach(item => {
        item.img = this.$store.state.baseUrl + item.img;
      });
      this.list = newlIst[0];
      this.list.wangEditor = this.filterHTMLTag(this.list.wangEditor);
    }
  },
  mounted() {
    // this.$api
    //   .getImg({ url: "\\upload\\1586857821896-32128357279800.jpg" })
    //   .then(res => {
    //     console.log(
    //       res,
    //       "获取图片",
    //       `\\upload\\1586857821896-32128357279800.jpg`
    //     );
    //   });
  },

  methods: {
    filterHTMLTag(msg) {
      var msg = msg.replace(/<\/?[^>]*>/g, ""); //去除HTML Tag
      msg = msg.replace(/[|]*\n/, ""); //去除行尾空格
      msg = msg.replace(/&nbsp;/gi, ""); //nbsp
      return msg;
    }
  }
};
</script>

<style lang='scss' scoped>
.gener_img {
  width: 859px;
  height: 331px;
}
.crumbs_cont_txt {
  margin-top: 40px;
  font-size: 16px;
  font-weight: 400;
  line-height: 35px;
  color: rgba(51, 51, 51, 1);
}
</style>
